import request from '@/utils/request'
// 查询首页热门院校数据
export const getArticleList = (params) => {
    return request({
      url: '/article',
      method: 'get',
      params
    });
  };

  //获取热门文章
export const getHotArticle = () => {
    return request({
      url: '/article/top10',
      method: 'get',
    });
  };
//获取文章详情
  export const getArticleDetail = (id) => {
    return request({
      url: `/article/${id}`,
      method: 'get',
    });
  };
  //点赞或取消点赞
  export const likeOrUnlikeArticle = (params) =>
  request({
    'url': `/article/like/${params.status}`,
    'method': 'POST',
    'params': { "id" : params.id}
  })

    //收藏或取消收藏
    export const FavoriteOrUnFavorite = (params) =>
    request({
      'url': `/article/favorite/${params.status}`,
      'method': 'POST',
      'params': { "id" : params.id}
    })

    
    //获取用户收藏列表
    export const getUserFavoriteList = (params) =>
    request({
      url: '/article/userFavorite',
      method: 'get',
    })